package com.zmc.product.infrastructure.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zmc.product.infrastructure.service.CommodityGoodsDetailService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.zmc.product.infrastructure.dao.CommodityGoodsDetailDao;
import com.zmc.product.infrastructure.entity.CommodityGoodsDetailEntity;


/**
 * @author zmc
 */
@Service("commodityGoodsDetailService")
public class CommodityGoodsDetailServiceImpl extends ServiceImpl<CommodityGoodsDetailDao, CommodityGoodsDetailEntity> implements CommodityGoodsDetailService {

    @Override
    public CommodityGoodsDetailEntity getBySpuId(String spuId) {
        LambdaQueryWrapper<CommodityGoodsDetailEntity> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(CommodityGoodsDetailEntity::getSpuId, spuId);
        return getOne(wrapper);
    }

}